package handler

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"video/api/request"
	"video/internal/dao"
	"video/internal/model"
)

func AddComment(c *gin.Context) {
	var req request.AddComment
	var comment model.Comment

	if req.UserId == 0 || req.VideoId == 0 || req.Context == "" {
		c.JSON(http.StatusOK, gin.H{
			"code": 100000,
			"msg":  "验证失败",
			"data": nil,
		})
		return
	}

	comment = model.Comment{
		UserId:  req.UserId,
		VideoId: req.VideoId,
		Context: req.Context,
	}

	dao.AddFile(&comment)

	c.JSON(http.StatusOK, gin.H{
		"code": http.StatusOK,
		"msg":  "评论成功",
		"data": true,
	})
}

func ListComment(context *gin.Context) {
	
}